home *** CD-ROM | disk | FTP | other *** search
/ AEMail 2.40 / AEMail v2.40.iso / arexx / subscribe.aem < prev    next >
Text File  |  1999-03-24  |  977b  |  43 lines

  1. /* Subscribe/Unsubscribe AREXX */
  2.  
  3. OPTIONS RESULTS
  4.  
  5. TRACE ALL
  6.  
  7. ADDRESS AEMAIL1
  8.  
  9. FOLDER LIST_FOLDERS
  10. fldrlst = RESULT
  11.  
  12. DO WHILE fldrlst ~= ""
  13.     PARSE VAR fldrlst fldr fldrlst
  14.     ADDRESS_BOOK GET fldr TYPE
  15.     IF (RESULT = 1) THEN DO
  16.         FOLDER fldr
  17.         FIRST NEW
  18.         HaveMsg = RESULT
  19.         DO WHILE HaveMsg = 1
  20.             REPLYTO
  21.             IF (RESULT) = "" THEN FROM
  22.             email = RESULT
  23.             EXTRACT USERID "'"email"'"
  24.             email = RESULT
  25.             SAVE TEXT
  26.             msg = RESULT
  27.             PARSE UPPER VAR msg bgn 'SUBSCRIBE ' listname
  28.             un = ""
  29.             len = LENGTH(bgn)-1
  30.             IF (len > 0) THEN
  31.                 un = SUBSTR(bgn, len)
  32.             IF (un = "UN") THEN
  33.                 ADDRESS_BOOK DELETE FROM GROUP fldr email 
  34.             ELSE
  35.                 ADDRESS_BOOK ADD TO GROUP fldr email
  36.             MESSAGE READ
  37.             NEXT NEW
  38.             HaveMsg = RESULT
  39.             END
  40.         END
  41.     END
  42.  
  43.